package com.hqyj.am.controller;

import com.hqyj.am.pojo.ResultVo;
import com.hqyj.am.pojo.User;
import com.hqyj.am.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.xml.transform.Result;

/**
 * @Author: chenglongfei
 * @date: 2022/8/17
 * @Description LoginController
 */
@RestController
@RequestMapping("/login")
public class LoginController {
    @Autowired
    LoginService loginService;

    //短信登录
    @PostMapping("smsLogin")
    public ResultVo smsLogin(User user){
        return  loginService.smsLogin(user);
    }

//    //用户名登录
//    @PostMapping("/userNameLogin")
//    public ResultVo userNameLogin(User user){
//        return loginService.userNameLogin(user);
//    }

    @PostMapping("/userLogin")
    public ResultVo userLogin(User user){
        return loginService.userLogin(user);
    }
}
